package com.erci.mapper;

import com.erci.entity.Category;
import com.erci.entity.VO.CategoryVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CategoryMapper {

    Page<Category> queryList(String name);

    @Insert("insert into category(name,create_time,update_time) values(#{name},#{createTime},#{updateTime})")
    void add(Category category);

    @Update("update category set name=#{name},update_time=#{updateTime} where id=#{id}")
    void update(Category category);

    @Delete("delete from category where id= #{id}")
    void deleteById(Integer id);

    @Select("select id,name from category")
    List<CategoryVO> allCategory();


    List<String> allCategoryNames(List<String> ids);
}
